package cn.edu.cdp.mapper;

import cn.edu.cdp.domain.User;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserMapper {
    @Insert("insert into user (name, gender, age, address, qq, email) VALUES (#{name}, #{gender}, #{age}, #{address}, #{qq}, #{email})")
    public void add(User user);
    @Select("select * from user")
    public List<User> findAll();
    @Delete("delete from user where id = #{id}")
    public void delete(int id);
    @Update("update user set name = #{name}, gender = #{gender}, age = #{age}, address = #{address}, qq = #{qq}, email = #{email} where id = #{id}")
    public void update(User user);
}
